package com.example.newspublish.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.example.newspublish.pojo.entity.SysLoginLog;
import com.example.newspublish.pojo.form.LoginQueryForm;
import com.example.newspublish.pojo.result.Result;
import com.example.newspublish.service.LoginLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("news/LoginLog")
public class SysLoginLogController {

    @Autowired
    private LoginLogService loginLogService;

    @Operation(summary = "获取分页列表", security = {@SecurityRequirement(name = "Authorization")})
    @GetMapping("/{pageNum}/{pageSize}")
    public Result getpage(@PathVariable("pageNum") Long pageNum,
                          @PathVariable("pageSize") Long pageSize,
    LoginQueryForm loginQueryForm){
        IPage<SysLoginLog> pageLog=loginLogService
                .selectPage(pageNum,pageSize,loginQueryForm);
        return Result.ok(pageLog);
    }


}
